package mapto;

import java.util.TreeMap;

public class Map3 {

	public static void main(String[] args) {

		String p = "fankaljeiabfzmnafhkajfhk";
		charCount(p);
	}

	public static String charCount(String str){
		char [] cha = str.toCharArray();
		TreeMap<Character,Integer> c = new TreeMap<Character,Integer>();
		for(int x = 0 ;x<cha.length;x++){
			Integer value =c.get(cha[x]);
			if(value == null){
				c.put(cha[x], 1);
			}else{
				value = value+1;
			}
		}
		System.out.println(c);
		return null;
	}
}
